--[[ 编码: JX-31-13 名称: 盘点差异-复盘 作者:HAN 日期:2025-03-01 函数: RepeatCount_ClickOK 功能: 盘点差异点击复盘后弹出复盘站台,选中站台后点击“确定”按钮后执行的脚本 更改记录: --]] wms_count = require( "wms_count" ) function ClickOK( strLuaDEID ) local nRet, strRetInfo local objs, obj, n -- step1 获取输入的站点信息 -- 改进测试 nRet, strRetInfo = mobox.getCurEditDataObjAttr( strLuaDEID, "Station" ) if ( nRet ~= 0 ) then lua.Error( strLuaDEID, debug.getinfo(1), "获取当前编辑属性失败! "..strRetInfo ) end local obj_attrs = json.decode( strRetInfo ) local station = lua.Get_StrAttrValue( obj_attrs[1].value ) -- step2 获取当前[盘点差异]表中选中的盘点差异 nRet, objs = m3.GetSysDataJson( strLuaDEID ) if ( nRet ~=0 ) then lua.Error( strLuaDEID, debug.getinfo(1), objs ) end -- [{"id":"","attrs":[{"attr":"","value":""},..]},..] local nCount = #objs if ( nCount == 0 ) then return end local count_diff_ids = {} for n = 1, nCount do table.insert( count_diff_ids, objs[n].id ) end nRet, strRetInfo = wms_count.Count_Diff_RepeatCount( strLuaDEID, station, count_diff_ids ) if ( nRet ~= 0 ) then mobox.stopProgram( strLuaDEID, strRetInfo ) return end end